<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('【请填写功能名称】列表')" />
    <th:block th:include="include :: header('仓库列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li class="select-time">
                                <p>出库时间：</p>
                                <input type="text" class="time-input" id="poststartTime" placeholder="开始时间" name="params[beginOutStoreOutDatetime]"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="postendTime" placeholder="结束时间" name="params[endOutStoreOutDatetime]"/>
                            </li>
                            <li>
                                <p>客户订单id：</p>
                                <input type="text" name="customerOrderId"/>
                            </li>
                            <li class="select-time">
                                <p>客户收货时间：</p>
                                <input type="text" class="time-input" id="getstartTime" placeholder="开始时间" name="params[beginOutStoreReceiverDatetime]"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="getendTime" placeholder="结束时间" name="params[endOutStoreReceiverDatetime]"/>
                            </li>
                            <li>
                                <p>出库操作员：</p>
                                <input type="text" name="outStorePerson"/>
                            </li>
                            <li>
                                <p>出库状态：</p>
                                <select name="outStoreStatus">
                                    <option value="">所有</option>
                                    <option value="待出库">待出库</option>
                                    <option value="已检验">已检验</option>
                                </select>
                            </li>
                            <li>
                            <li>
                                <p>仓库名称：</p>
                                <input type="text" name="storeName"/>
                            </li>
                            <li>
                                <p>仓库类型：</p>
                                <select name="storeType" th:with="type=${@dict.getType('')}">
                                    <option value="">--请选择--</option>
                                    <option value="冷冻仓库">冷冻仓库</option>
                                    <option value="水果仓库">水果仓库</option>
                                    <option value="其他仓库">其他仓库</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <p>仓库状态：</p>
                                <select name="storeState">
                                    <option value="">--请选择--</option>
                                    <option value="空仓">空仓</option>
                                    <option value="满仓">满仓</option>
                                    <option value="可用">可用</option>
                                </select>
                            </li>
                            <li>
                                <p>仓库地址：</p>
                                <input type="text" name="storeAddress"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:store:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:store:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:store:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:store:export">
                    <i class="fa fa-download"></i> 导出
                 </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('system:store:edit')}]];
        var removeFlag = [[${@permission.hasPermi('system:store:remove')}]];
        var prefix = ctx + "system/store";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "【请填写功能名称】",
                columns: [{
                    checkbox: true
                },
                {
                    field : 'storeId',
                    title : '仓库id',
                    //visible: false
                },
                {
                    field : 'storeName',
                    title : '仓库名称'
                },
                {
                    field : 'storeType',
                    title : '仓库类型'
                },
                {
                    field : 'storeState',
                    title : '仓库状态'
                },
                {
                    field : 'storeAddress',
                    title : '仓库地址'
                    field : 'outStoreId',
                    title : '出库单id'
                    //visible: false
                },
                {
                    field : 'outStoreOutDatetime',
                    title : '出库时间'
                },
                {
                    field : 'customerName',
                    title : '收货人'
                },
                {
                    field : 'customerOrderAddress',
                    title : '收货地址'
                },
                {
                    field : 'outStoreReceiverDatetime',
                    title : '客户收货时间'
                },
                {
                    field : 'productName',
                    title : '商品名称'
                },
                {
                    field : 'customerOrderItemNumber',
                    title : '商品数量'
                },
                {
                    field : 'outStorePerson',
                    title : '出库操作员'
                },
                {
                    field : 'outStoreStatus',
                    title : '出库状态'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.outStoreId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.outStoreId + '\')"><i class="fa fa-remove"></i>删除</a>');
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.storeId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.storeId + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>